---
# tasks file for trassir
- name: root password
  ansible.builtin.user:
    name: root
    update_password: always
    password: "{{ root_password }}"

- name: openbox & xorg server
  ansible.builtin.apt:
    pkg:
    - openbox
    - xorg

- name: trassir package
  ansible.builtin.apt:
    name: t1client-standalone
    state: latest

- name: trassir user
  ansible.builtin.user:
    name: trassir
    shell: /bin/bash
    password: $1$bGCj0tgF$7OtnXFWPI.EFtLxmHCGWu/

- name: autologin directory
  ansible.builtin.file:
   path: /etc/systemd/system/getty@tty1.service.d
   state: directory
   mode: '755'

- name: autologin config
  ansible.builtin.copy:
    src: override.conf
    dest: /etc/systemd/system/getty@tty1.service.d

- name: trassir autostart
  ansible.builtin.lineinfile:
    dest: /etc/xdg/openbox/autostart
    line: /opt/dssl/t1client/run_t1client.sh

- name: start X server
  ansible.builtin.lineinfile:
    dest: /home/trassir/.bashrc
    line: startx
  notify:
  - reboot
